/*t+WPiEJis82j7JmzGN1ONarXwGD1Iwr/0JZAJZGtEhSH/gtO8icMzVIB2fchgZvr*/
/*
 * @Author: xiahui 
 * @PageInfo: 联查价格明细 
 * @Date: 2019-02-22 09:42:37 
 * @Last Modified by: xiahui
 * @Last Modified time: 2019-07-16 13:47:14
 */
import { AREA, FIELDS } from '../../constance';
import { showErrorInfo } from '../../../../../scmpub/scmpub/pub/tool/messageUtil';
import { getLangByResId } from '../../../../../scmpub/scmpub/pub/tool/multiLangUtil';

export default function(props, moduleId) {
	let checkedRows = props.cardTable.getCheckedRows(moduleId);
	if (!checkedRows || checkedRows.length == 0) {
		showErrorInfo(null, getLangByResId(this, '4004PURDAILY-000019')); /* 国际化处理： 请选择具体的合同行进行联查*/
		return;
	}
	let pk_ct_price = checkedRows[0].data.values[FIELDS.pk_ct_price].value;
	if (!pk_ct_price) {
		showErrorInfo(null, getLangByResId(this, '4004PURDAILY-000020')); /* 国际化处理： 选中行没有记录价格信息表*/
		return;
	}
	let bbracketorder = props.form.getFormItemsValue(AREA.cardFormId, FIELDS.bbracketorder).value;
	if (bbracketorder) {
		showErrorInfo(null, getLangByResId(this, '4004PURDAILY-000021')); /* 国际化处理： 总括订单不能联查价格明细*/
		return;
	}

	props.openTo(null, {
		appcode: '400400602',
		pagecode: '400400602_card',
		pk_org: props.form.getFormItemsValue(AREA.cardFormId, FIELDS.pk_org).value,
		ctrantypeid: props.form.getFormItemsValue(AREA.cardFormId, FIELDS.ctrantypeid).value,
		pk_ct_pu: props.form.getFormItemsValue(AREA.cardFormId, FIELDS.pk_ct_pu).value,
		pk_ct_price: pk_ct_price,
		nqtorigtaxprice: checkedRows[0].data.values[FIELDS.nqtorigtaxprice].value
	});
}

/*t+WPiEJis82j7JmzGN1ONarXwGD1Iwr/0JZAJZGtEhSH/gtO8icMzVIB2fchgZvr*/